package topics;

/*
 * This class represents a subtopic.
 */

/**
 *
 * @author link3988
 */
import java.util.ArrayList;
public class SubTopic extends Topic{

    private String topic = "";
    ArrayList<MicroTopic> microtopics;
    public SubTopic(String tp)
    {
        setTopic(tp);
        microtopics = new ArrayList();
    }

    /**
     *
     * @return the subtopic
     */
    public String getTopic()
    {
        return super.getTopic();
    }

    /**
     * adds a micro topic to this subtopic.
     * @param mctp
     */
    public void addMicroTopic(MicroTopic mctp)
    {
        microtopics.add(mctp);
    }

    /**
     *
     * @return the size of this subtopic's microtopics
     */
    public int microSize()
    {
        return microtopics.size();
    }

    /**
     *
     * @param index
     * @return the microtopic at the specified index
     */
    public MicroTopic getMicroTopic(int index)
    {
        return microtopics.get(index);
    }

    /**
     * appends to the topic the addition.
     * @param addition
     */
     public void addToTopic(String addition)
    {
        super.addToTopic(addition);
    }

     /**
      * changes the topic to the new topic.
      * @param newTopic
      */
    public void setTopic(String newTopic)
    {
        super.setTopic(newTopic);
    }

}
